﻿using System.Linq;
using Transformable_Engine_v2.Engine.Graphics;

namespace Super_Management_Mayhem.Screens.Result
{
    public class TeamResult
    {
        public PlayerResult[] Players { get; private set; }
        public int TotalScore { get; private set; }

        public Color Color { get; private set; }

        public string Name { get; private set; }

        public TeamResult(Color teamColor, string name,
                          params PlayerResult[] players)
            : this(players.Sum(p => p.Score), teamColor, name, players)
        {
            
        }

        public TeamResult(int totalScore,
                          Color teamColor,
                          string name,
                          params PlayerResult[] players)
        {
            Players = players;
            TotalScore = totalScore;
            Color = teamColor;
            Name = name;
        }
    }
}